﻿<UserControl x:Class="PatternLocker.Controls.DirectionButton"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:primitives="clr-namespace:System.Windows.Controls.Primitives;assembly=PresentationFramework" 
             mc:Ignorable="d">

    <Grid Name="grdDirection" Background="Transparent" Height="15" Width="15">
        <TextBlock Name="txtDirection" Visibility="Collapsed" />
        <primitives:ToggleButton x:Name="tglDirection" Background="Transparent" 
                                 Checked="ToggleButton_CheckedChanged" Unchecked="ToggleButton_CheckedChanged">
            <primitives:ToggleButton.Template>
                <ControlTemplate x:Name="tmpltMain" TargetType="primitives:ToggleButton">
                    <Grid>
                        <TextBlock Name="txtDirectionTemplate" FontSize="15"
                                   Text="{Binding ElementName=txtDirection, Path=Text}"
                                   FontFamily="Arial" FontWeight="Bold" 
                                   Foreground="{Binding ElementName=txtDirection, Path=Foreground}" 
                                   HorizontalAlignment="Center" VerticalAlignment="Center" 
                                   MouseEnter="txtDirectionTemplate_MouseEnter"
                                   MouseLeave="txtDirectionTemplate_MouseLeave" />
                        <TextBlock Name="txtDirectionTemplate2" FontSize="15" 
                                   Margin="{Binding ElementName=txtDirection, Path=Margin}"
                                   Text="{Binding ElementName=txtDirection, Path=Text}"
                                   FontFamily="Arial" FontWeight="Bold" Foreground="Black" 
                                   HorizontalAlignment="Center" VerticalAlignment="Center" 
                                   MouseEnter="txtDirectionTemplate_MouseEnter"
                                   MouseLeave="txtDirectionTemplate_MouseLeave" />
                    </Grid>
                </ControlTemplate>
            </primitives:ToggleButton.Template>
        </primitives:ToggleButton>
    </Grid>
</UserControl>
